import 'package:flutter/material.dart';
import 'package:flutter_learner/src/pages/state/single_provider_demo.dart';

import 'multi_provider_demo.dart';

class ProviderStateDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SingleChildScrollView(
        child: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              RaisedButton(
                colorBrightness: Brightness.dark,
                onPressed: () {
                  Navigator.of(context)
                      .push(new MaterialPageRoute(builder: (_) {
                    return SingleProviderDemo();
                  }));
                },
                child: Text('单个的Provider使用'),
              ),
              RaisedButton(
                colorBrightness: Brightness.dark,
                onPressed: () {
                  Navigator.of(context)
                      .push(new MaterialPageRoute(builder: (_) {
                    return MultiProviderDemo();
                  }));
                },
                child: Text('多个的Provider使用（结合Stream）'),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
